package com.nd.test.controller;

import java.util.List;
import java.util.Date;

import model.po.CouponsSendingType;
import com.nd.test.vo.CouponsSendingTypeVo;
import com.nd.test.repository.CouponsSendingTypeRepository;
import com.nd.test.service.CouponsSendingTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**   
 * Create by apisdk 
 */
@RestController
@RequestMapping(value="/couponsSendingType")
public class CouponsSendingTypeController {
	@Autowired
	private CouponsSendingTypeRepository couponsSendingTypeRepository;

	@Autowired
	private CouponsSendingTypeService couponsSendingTypeService;

	/**
	* @description create model
	* @return
	*/
	@RequestMapping(value= "", method = RequestMethod.POST)
	public CouponsSendingTypeVo createCouponsSendingType(@RequestBody CouponsSendingTypeVo couponsSendingTypeVo) throws Exception {
		return couponsSendingTypeService.createCouponsSendingType(couponsSendingTypeVo);
	}

	/**
	* @description get model through id
	* @return
	*/
	@RequestMapping(value= "/{id}", method = RequestMethod.GET)
	public CouponsSendingTypeVo getCouponsSendingTypeById(@PathVariable String id){
		return couponsSendingTypeService.getCouponsSendingTypeById(id);
	}

	/**
	* @description update model through id
	* @return
	*/
	@RequestMapping(value= "/{id}", method = RequestMethod.PUT)
	public CouponsSendingTypeVo updateCouponsSendingTypeById(@PathVariable String id,@RequestBody CouponsSendingTypeVo couponsSendingTypeVo){
		return couponsSendingTypeService.updateCouponsSendingTypeById(id,couponsSendingTypeVo);
	}

	/**
	* @description delete model through id
	* @return
	*/
	@RequestMapping(value= "/{id}", method = RequestMethod.DELETE)
	public void deleteCouponsSendingTypeById(@PathVariable String id){
		couponsSendingTypeService.deleteCouponsSendingTypeById(id);
		return;
	}

}
